<div style="display: none">
    <div z-delete-confirm="deleteSnapshot" z-options="optionsDeleteSnapshot"></div>
    <div z-volume-revert-to-snapshot="revertSnapshot" z-options="optionsRevertSnapshot"></div>
    <div z-delete-confirm="deleteSnapshotWin" z-options="optionsDeleteSnapshot"></div>
    <div z-backup-snapshot="backupSnapshotWin" z-options="optionsBackupSnapshot"></div>
    <div z-delete-snapshot-from-backup-storage="deleteSnapshotFromBackupStorageWin" z-options="optionsDeleteSnapshotFromBackupStorage"></div>
</div>

<div class="z-pane">
    <ol class="breadcrumb">
        <li><a href="/#/volume">{{ "volume.snapshotDetails.VOLUME" | translate }}</a></li>
        <li><a href="/#/volume/{{model.current.volumeUuid}}">{{model.current.volumeUuid}}</a></li>
        <li>{{ "volume.snapshotDetails.snapshots" | translate }}</li>
        <li class="active"><a href>{{model.current.name}}</a></li>
    </ol>

    <h1>{{model.current.name}}</h1>

    <div class="z-pane-toolbar" ng-show="funcToolbarShow()">
        <div class="btn-group-sm">
            <button type="button" class="btn btn-default btn-sm z-ribbon-button" ng-click="funcRefresh()">
                <i class="fa fa-refresh"></i>
            </button>
            <div class="btn-group">
                <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                    Action <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li><a href ng-click="action.revert()" ng-show="model.current.isRevertShow()">{{ "volume.snapshotDetails.Revert Volume To This Snapshot" | translate }}</a></li>
                    <li><a href ng-click="action.backup()" ng-show="model.current.isBackupShow()">Backup</a></li>
                    <li><a href ng-click="action.deleteFromBackupStorage()" ng-show="model.current.isDeleteFromBackupStorageShow()">{{ "volume.snapshotDetails.Delete From Backup Storage" | translate }}</a></li>
                    <li class="divider"></li>
                    <li><a href style="color:red" ng-click="action.delete()">{{ "volume.snapshotDetails.Delete" | translate }}</a></li>
                </ul>
            </div>
        </div>
    </div>

    <ul class="nav nav-pills">
        <li class="active"><a data-target="#info" data-toggle="pill" href>{{ "volume.snapshotDetails.Info" | translate }}</a></li>
        <li><a data-target="#backupStorage" data-toggle="pill" href>{{ "volume.snapshotDetails.Backup Storage" | translate }}</a></li>
    </ul>

    <div class="tab-content">
        <div class="tab-pane active" id="info">
            <tags-input ng-model="optionsTag.tags" display-property="tag" min-length="1"
                        on-tag-added="optionsTag.createTag($tag)" on-tag-removed="optionsTag.deleteTag($tag)"
                        add-on-comma="false" replace-spaces-with-dashes="false" ng-show="optionsTag.isShow()"></tags-input>

            <div class="panel panel-default" z-panel-header-in>
                <div class="panel-heading">
                    <a class="accordion-toggle" data-target="#infoDetails" data-toggle="collapse" href>
                        <i class="z-collapse fa fa-chevron-down"></i>
                        <span>&nbsp; {{ "volume.snapshotDetails.DETAILS" | translate }}</span>
                    </a>
                </div>

                <div id="infoDetails" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <table class="table z-table-borderless">
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.DESCRIPTION" | translate }}</span></td>
                                <td><span class="z-description">{{model.current.description}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.STATUS" | translate }}</span></td>
                                <td><span class="{{model.current.statusLabel()}}">{{model.current.status}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.HYPERVISOR" | translate }}</span></td>
                                <td><span>{{model.current.hypervisorType}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.TYPE" | translate }}</span></td>
                                <td><span>{{model.current.type}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.SIZE" | translate }}</span></td>
                                <td><span>{{model.current.size}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.VOLUME TYPE" | translate }}</span></td>
                                <td><span>{{model.current.volumeType}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.UUID" | translate }}</span></td>
                                <td><span>{{model.current.uuid}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.TREE UUID" | translate }}</span></td>
                                <td>{{model.current.treeUuid}}</td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.PARENT UUID" | translate }}</span></td>
                                <td><a href="/#/volume/snapshot/{{model.current.parentUuid}}">{{model.current.parentUuid}}</a></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.PRIMARY STORAGE UUID" | translate }}</span></td>
                                <td><a href="/#/primaryStorage/{{model.current.primaryStorageUuid}}">{{model.current.primaryStorageUuid}}</a></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.PRIMARY INSTALL PATH" | translate }}</span></td>
                                <td><span>{{model.current.primaryStorageInstallPath}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.VOLUME UUID" | translate }}</span></td>
                                <td><a href="/#/volume/{{model.current.volumeUuid}}">{{model.current.volumeUuid}}</a></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.IS LATEST IN TREE" | translate }}</span></td>
                                <td>{{model.current.latest}}</td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.CREATED DATE" | translate }}</span></td>
                                <td><span>{{model.current.createDate}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{ "volume.snapshotDetails.LAST UPDATED DATE" | translate }}</span></td>
                                <td><span>{{model.current.lastOpDate}}</span></td>
                            </tr>
                        </table>
                    </div>

                </div>
            </div>
        </div>

        <div class="tab-pane" id="backupStorage">
            <div kendo-grid k-options="optionsBackupStorageGrid" class="z-flat-table"></div>
        </div>
    </div>
</div>
